Skip to content

fix(tui): hide system-trigger messages in resume replay - #1990

Merged
liruifengv merged 1 commit into
mainfrom
fix/tui-replay-system-trigger-leak
Jul 21, 2026
Merged

fix(tui): hide system-trigger messages in resume replay#1990
liruifengv merged 1 commit into
mainfrom
fix/tui-replay-system-trigger-leak

Conversation

@liruifengv

Copy link
Copy Markdown
Collaborator

Related Issue

N/A — the problem is explained below.

Problem

When resuming a session that ran in goal mode, the replay leaks goal mode's internal continuation prompt ("Continue working toward the active goal…") into the transcript as a user message. Each goal turn injects this prompt as a user message carrying a system_trigger origin; it is model-facing only and the live TUI never renders it. Resume replay, however, only filtered three specific system_trigger names (goal_completion, goal_blocked, goal_fork_cleared), so the continuation prompt fell through to the default branch and rendered as a user message.

What changed

  • Resume replay now skips all user messages with a system_trigger origin (goal continuation prompts, goal outcome/cancel reminders, stop-hook reasons, etc.). This matches the live render path and the markdown exporter, which already treat these messages as internal.
  • Removed the two goal-specific system_trigger filters made redundant by the general rule.
  • Added a regression test covering goal continuation and goal cancellation messages.

Checklist

  • I have read the CONTRIBUTING document.
  • I have linked a related issue, or explained the problem above.
  • I have added tests that prove my feature works.
  • Ran gen-changesets skill, or this PR needs no changeset.
  • Ran gen-docs skill, or this PR needs no doc update.

Goal mode stores its per-turn continuation prompt as a user message with
a system_trigger origin. Live rendering never shows these model-facing
messages, but resume replay only filtered three specific system_trigger
names, so the continuation prompt leaked into the transcript as a user
message. Skip all system_trigger user messages during replay, matching
the live path and the markdown exporter, and drop the two goal-specific
filters this makes redundant.
@changeset-bot

changeset-bot Bot commented Jul 21, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 46e8474

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@moonshot-ai/kimi-code Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@pkg-pr-new

pkg-pr-new Bot commented Jul 21, 2026

Copy link
Copy Markdown
pnpm dlx https://pkg.pr.new/@moonshot-ai/kimi-code@46e8474
npx https://pkg.pr.new/@moonshot-ai/kimi-code@46e8474

commit: 46e8474

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 46e847425e

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread apps/kimi-code/src/tui/controllers/session-replay.ts
@liruifengv
liruifengv merged commit 115b096 into main Jul 21, 2026
15 checks passed
@liruifengv
liruifengv deleted the fix/tui-replay-system-trigger-leak branch July 21, 2026 04:16
@github-actions github-actions Bot mentioned this pull request Jul 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant